<?php


class QuestionAnswer extends CActiveRecord
{
	
	public function tableName()
	{
		return 'question_answer';
	}

	
	public function rules()
	{
		
		
		return array(
			array('question_test_id', 'required'),
			array('order_number, status, choose', 'numerical', 'integerOnly'=>true),
			array('question_test_id', 'length', 'max'=>20),
			array('content, MT', 'length', 'max'=>1000),
			array('create_date', 'safe'),
			
			
			array('id, question_test_id, order_number, content, MT, status, choose, create_date, modify_date', 'safe', 'on'=>'search'),
		);
	}

	
	public function relations()
	{
		
		
		return array(
			'questionTest' => array(self::BELONGS_TO, 'QuestionTest', 'question_test_id'),
		);
	}

	
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'question_test_id' => 'Question Test',
			'order_number' => 'Order Number',
			'content' => 'Content',
			'MT' => 'MT',
			'status' => 'Status',
			'choose' => 'Choose',
			'create_date' => 'Create Date',
			'modify_date' => 'Modify Date',
		);
	}

	
	public function search()
	{
		

		$V0v5vsnfxezw=new CDbCriteria;

		$V0v5vsnfxezw->compare('id',$this->id,true);
		$V0v5vsnfxezw->compare('question_test_id',$this->question_test_id,true);
		$V0v5vsnfxezw->compare('order_number',$this->order_number);
		$V0v5vsnfxezw->compare('content',$this->content,true);
		$V0v5vsnfxezw->compare('MT',$this->MT,true);
		$V0v5vsnfxezw->compare('status',$this->status);
		$V0v5vsnfxezw->compare('choose',$this->choose);
		$V0v5vsnfxezw->compare('create_date',$this->create_date,true);
		$V0v5vsnfxezw->compare('modify_date',$this->modify_date,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$V0v5vsnfxezw,
		));
	}

	
	public static function model($Vgmajjibziuy=__CLASS__)
	{
		return parent::model($Vgmajjibziuy);
	}
}
